package com.april.service.impl;

import com.april.mapper.TbItemParamMapper;
import com.april.pojo.TbItemParam;
import com.april.pojo.TbItemParamExample;
import com.april.service.ItemParamService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author: 槐序 廿一
 * @Date: 2023-06-19
 * @Time: 21:00
 * @Description:
 */
@Service
@Transactional
public class ItemParamServiceImpl implements ItemParamService {

    @Resource
    TbItemParamMapper tbItemParamMapper;

    @Override
    public TbItemParam selectItemParamByItemCatId(Long itemCatId) {
        TbItemParamExample tbItemParamExample = new TbItemParamExample();
        tbItemParamExample.createCriteria().andItemCatIdEqualTo(itemCatId);
        List<TbItemParam> tbItemParams = tbItemParamMapper.selectByExampleWithBLOBs(tbItemParamExample);
        return tbItemParams.get(0);
    }
}
